|
|
|
|
|
|
|
This lesson will show you how to define the data you'll need in your database, the structure of the database itself, and what it takes to actually create the working database. You'll also see how to use the Visual Data Manager included with Visual Basic. Finally, you'll get a short lesson in what SQL (Structured Query Language) is and how to use it. |
|
|
|
|
|
|
|
|
The same steps that you take to design an application can be applied to the database design as well. Before designing the first form, you must have a completed data design to work with. |
|
|
|
|
|
|
|
|
Note Even though the database design is completed, changes probably will be made to it as you design the application. Don't worry about these changes; if the original design is good, the changes should be easy to apply. |
|
|
|
|
|
|
|
|
|
When you design your application, you not only need to design your program code for performance, but you must also pay attention to the logical and physical design of the database. A good database design does the following for your application: |
|
|
|
|
|
|
|
|
Allows data to be stored efficiently so that the database doesn't get larger that absolutely necessary |
|
|
|
|
|
|
|
|
Provides for easy data updates |
|
|
|
|
|
|
|
|
Provides a flexible design to allow for the addition of new functions, tables, or data |
|
|
|
|
|
|
|
|
Allows searches to be performed quickly |
|
|
|
|
|
|
|
|
All of these are provided in a relational database. Relational databases got their names because they contain tables that are related to one another by certain key data in the table. For example, if you kept employee records for a company, you might have two separate tables: one to keep private employee information and one to keep job-related information for each employee. The employee table would have a row for each person and columns for each unique piece of data. The job table might have multiple rows for each employee, depending on how many different jobs that person has held in the company, and of course columns to hold the specific data. |
|
|
|
|
|
|
|
|
Now, if you were looking for a particular person's job description, you would go to the employee table and find the name of that person. Then by using his or her employee number, you would go to the job table, find the employee number, and look at the job description. This method of connecting data from different tables is what makes a relational database what it is. |
|
|
|
|
|